#include<stdio.h>
#include<string.h>
int main()
{
    //freopen("in.txt","r",stdin);
    int ans = 0;
    char s[2000];
    scanf("%s",s);
    int len = strlen(s);
    int top = 0;
    int Stack[2000];
    int i = 0;
    while (s[i] != '@')
    {
        if('0' <= s[i] && s[i] <= '9')
        {
            int k = s[i] - '0';
            while (s[i+1] != '.')
            { 
                i++;
                k = k * 10;
                k = k + s[i] - '0';
            }
            Stack[top++] = k;
        }
        if(s[i] == '+') 
        {
            int a = Stack[--top];
            int b = Stack[--top];
            ans = b + a;
            Stack[top++] = ans;
        }
        if(s[i] == '-')
        {
            int a = Stack[--top];
            int b = Stack[--top];
            ans = b - a;
            Stack[top++] = ans;
        }
        if(s[i] == '*')
        {
            int a = Stack[--top];
            int b = Stack[--top];
            ans = b * a;
            Stack[top++] = ans;
        }
        if(s[i] == '/')
        {
            int a = Stack[--top];
            int b = Stack[--top];
            ans = b/a;
            Stack[top++] = ans;
        }
        //printf("%d\n",ans);
        i++;
    }
    printf("%d",Stack[--top]);
}